473,416 Members | 1,797 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,416 software developers and data experts.

Creating a html drop-down list dynamically

Hi there

I would like to write a javascript function that creates a drop-down
list dynamically. I read on the docs that most HTML controls can not
be created on run-time. what kind of work-arounds do you use in this
case? maybe DHTML?
do you have any example ?
Javascript allows you to create the options of the drop-down list
dynamically but not the drop-down list itself, I believe.
Actually the same question goes for any other HTML control.

any reference, example, link, suggestion greatly appretiated.

Thanks a lot

Gurry
Jul 20 '05 #1
4 3659
In article <1a**************************@posting.google.com >,
jf**@cisco.com enlightened us with...
Hi there

I would like to write a javascript function that creates a drop-down
list dynamically. I read on the docs that most HTML controls can not
be created on run-time. what kind of work-arounds do you use in this
case? maybe DHTML?
do you have any example ?
Javascript allows you to create the options of the drop-down list
dynamically but not the drop-down list itself, I believe.
Actually the same question goes for any other HTML control.

any reference, example, link, suggestion greatly appretiated.


Sure you can, for modern browsers that support createElement.
http://msdn.microsoft.com/workshop/a...methods/create
element.asp

For full dhtml reference for IE, see
http://msdn.microsoft.com/library/default.asp?
url=/workshop/author/dhtml/reference/methods.asp

Note that not all browsers support createElement or all of MSIE DHTML.
For the second most popular browser, see NN/Mozilla docs here.
http://www.mozilla.org/docs/web-developer/

--
--
~kaeli~
A man's home is his castle..., in a manor of speaking.
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #2
kaeli wrote on 18 Dec 2003 at Thu, 18 Dec 2003 16:10:37 GMT:
Sure you can, for modern browsers that support createElement.
http://msdn.microsoft.com/workshop/a...erence/methods
/create element.asp


The createElement method is actually part of W3C's DOM
specification. Modern versions of all browsers that support DOM,
including IE, Mozilla, Netscape and Opera, should implement
document.createElement().

Mike

--
Michael Winter
M.******@blueyonder.co.invalid (replace ".invalid" with ".uk")
Jul 20 '05 #3
"Michael Winter" <M.******@blueyonder.co.invalid> wrote in message
news:Xn*******************************@193.38.113. 46...
<snip>
Sure you can, for modern browsers that support createElement.
http://msdn.microsoft.com/workshop/a...tml/reference/
methods/create element.asp


The createElement method is actually part of W3C's DOM
specification. Modern versions of all browsers that
support DOM, including IE, Mozilla, Netscape and Opera,
should implement document.createElement().


A problem arises with less dynamic browsers, they can reasonably
implement the official DOM structure (childNodes, parentNode and so on)
convenience properties and element/collection retrieval methods making
access and navigation of a standardised DOM practical but if they are
not dynamic enough to reflect changes in the DOM structure into changes
in the displayed page it might reasonably be argued that not
implementing createElement, replaceChild and so on is a good way of
advertising the limited capabilities of the browser to the script
author. These days the less dynamic browsers tend to be found on
smaller devices but the modern ones do seem to go as far as practical
towards implementing the W3C DOM, they just don't include the more
dynamic methods.

Richard.
Jul 20 '05 #4
In article <Xn*******************************@193.38.113.46 >,
M.******@blueyonder.co.invalid enlightened us with...
kaeli wrote on 18 Dec 2003 at Thu, 18 Dec 2003 16:10:37 GMT:
Sure you can, for modern browsers that support createElement.
http://msdn.microsoft.com/workshop/a...erence/methods
/create element.asp


The createElement method is actually part of W3C's DOM
specification. Modern versions of all browsers that support DOM,
including IE, Mozilla, Netscape and Opera, should implement
document.createElement().


I know. If you pointed that out because of the link to MS, I linked
there because I like the docs. The MS docs are my fav source of info for
the "new" kinds of DHTML because they have rather nice examples and the
properties and methods are easy to find. It's searchable, too.

If anyone has Mozilla/Netscape docs set up this nice, I'd love a link.
The source I have does the job as far as making sure something works in
NN, but isn't nearly as nice as the MS site.

--
--
~kaeli~
Do cemetery workers prefer the graveyard shift?
http://www.ipwebdesign.net/wildAtHeart
http://www.ipwebdesign.net/kaelisSpace

Jul 20 '05 #5

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Barbara Lindsey | last post by:
Thank you for your help on the trigger question. The RULE worked for most of the cases I had for this, but I have one that is giving me trouble. Here are my table definitions: CREATE SEQUENCE...
8
by: Brian S. Smith | last post by:
Hi gang, Please help. I've been through the Access help, searched the Web, and I can't seem to get a straight answer. As the Subject line suggests, I want to run a fairly simple VB/Access Sub...
3
by: Kyle Fitzgerald | last post by:
I've started a web control library project and can build my own controls to add to the toolbox in the .NET environment. The problem I'm having is I want to create a control just like the HTML...
3
by: A.M | last post by:
Hi, Using ASP.NET/VB.NET and SQL Server backend, I need to return calculation results to user as an Access MDB file or Excel XLS sheet. What would be the best way to create a MDB or XLS file...
4
by: Coleen | last post by:
Hi All :-) Can anyone give me a URL where I can find a good example of code on how to create a temporary SQL table using VB.net? I've checked the Microsoft site at: ...
0
by: GautamKumar | last post by:
Hi All, I want to drag and drop files from Windows Explorer to an HTML Page.On Drop of a particular File i want to know the path of that File where it is stored.I dont want to use any...
7
by: freako9699 | last post by:
I would like to create a blog script, with a mysql back-end, a basic admin panel then can just add/edit posts and delete comments. no user auth required. how do i go about doing that, i no how to...
10
by: John Salerno | last post by:
Ok, this is completely unnecessary so I don't intend to get into stuff that's beyond my skill, but I'm wondering how simple it would be to use Python to create a server that runs on my computer so...
2
by: AR123 | last post by:
I want to convert my website tables layout to div tags as someone told me its easier to make changes etc etc I just need some help in getting started with this and what to put in the stylesheet. the...
6
by: cleary1981 | last post by:
I have adapted code from http://dunnbypaul.net/js_mouse/ I want to use a button to create new draggable divs but i keep getting error "is null or not an object" heres the code <html> <head>...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.